Method and apparatus for training search recommendation model, and method and apparatus for sorting search results

ABSTRACT

A method and an apparatus for training a search recommendation model, and a method and an apparatus for sorting search results are provided. The training method includes: obtaining a training sample set including a sample user behavior group sequence and a masked sample user behavior group sequence; and using the training sample set as input data, and training a search recommendation model, to obtain a trained search recommendation model, where a target of the training is to obtain the object of the response operation of the sample user after the mask processing, the search recommendation model is used to predict a label of a candidate recommendation object in search results corresponding to a query field when a target user inputs the query field, and the label is used to indicate a probability that the target user performs a response operation on the candidate recommendation object.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2021/093618, filed on May 13, 2021, which claims priority toChinese Patent Application No. 202010424719.3, filed on May 19, 2020.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the artificial intelligence field, andmore specifically, to a method and an apparatus for training a searchrecommendation model, and a method and an apparatus for sorting searchresults.

BACKGROUND

Selectivity prediction indicates predicting a probability that a userselects a commodity in a specific environment. For example, selectivityprediction based on a search word (also referred to as a query word or aquery field) input by the user plays a key role in a searchrecommendation system of applications such as an application store andan online advertisement. For example, objects in a candidate setcorresponding to the query word may be sorted based on the selectivityprediction, to generate search results. User experience can be improvedthrough the selectivity prediction.

Currently, in the search recommendation system, the search results maybe generated through sorting the objects in the candidate set by using asorting function of learning associations between objects in a searchword-candidate set. However, only static information of the currentsearch, that is, information of the search word is considered in theforegoing sorting function. Different users obtain the same sortedsearch results when inputting the same search word. In other words,accuracy of search results obtained based on a current searchrecommendation model is relatively low, and requirements of differentusers cannot be met; and therefore, user experience is relatively poor.

Therefore, how to improve accuracy of the search recommendation modeland improve user experience is a problem that needs to be urgentlyresolved.

SUMMARY

The present disclosure provides a method and an apparatus for training asearch recommendation model, and a method and an apparatus for sortingsearch results, to improve accuracy of the search recommendation modeland accuracy of the feedback search results.

According to a first aspect, a method for training a searchrecommendation model is provided, including: obtaining a training sampleset, where the training sample set includes a sample user behavior groupsequence and a masked sample user behavior group sequence, the sampleuser behavior group sequence includes a first query field and an objectof a response operation of a sample user in search results correspondingto the first query field, and the masked sample user behavior groupsequence includes a second query field and a sequence obtained aftermask processing is performed on an object of a response operation of thesample user in search results corresponding to the second query field;and using the training sample set as input data, and training a searchrecommendation model, to obtain the trained search recommendation model,where a training target is to obtain the object of the responseoperation of the sample user after the mask processing, the searchrecommendation model is used to predict a label of a candidaterecommendation object in search results corresponding to a query fieldwhen a target user inputs the query field, and the label is used toindicate a probability that the target user performs a responseoperation on the candidate recommendation object.

It should be understood that the foregoing sample user behavior groupsequence may be a group of data that is of the sample user and that issorted in a time sequence, for example, behavior log data of the sampleuser.

In a possible implementation, the training sample set may be dataobtained from a user behavior log of the sample user, and includes ahistorical query field of the sample user and a response operation ofthe sample user to a candidate recommendation object in search resultscorresponding to the historical query field, for example, operationsperformed by the sample user on a candidate recommendation object insearch results corresponding to a query field such as a click operation,a download operation, a purchase operation, and a browse operation.

In a possible implementation, the candidate recommendation object mayinclude any one of a document, a service product, an advertisement, andan application.

In a possible implementation, the label of the candidate recommendationobject may be an evaluation score of the candidate recommendation objectcorresponding to the query field. A candidate recommendation object witha higher evaluation score may indicate a higher probability that theuser performs a response operation on the candidate recommendationobject based on historical behavior data of the user. In this case, thecandidate recommendation object may be placed at a front location in thesearch results.

In this embodiment, in a process of training the search recommendationmodel, data that includes the query field of the user and the responseoperation of the user may be used, so that the search recommendationmodel can learn, based on historical behavior logs of different users,an association relationship between the query field and the responseoperation of the user. In other words, the search recommendation modelin the present disclosure can be effectively trained by using thehistorical behavior data of the user, so that the trained searchrecommendation model can predict a label of a candidate recommendationobject in search results corresponding to a query field when the userinputs the query field. A search intention of the user can be recognizedbased on the label of the candidate recommendation object, to improveaccuracy of feedback search results, that is, improve accuracy of thesearch recommendation model.

In a possible implementation, the training sample set may include aplurality of pieces of sample data. The plurality of pieces of sampledata may be historical behavior group sequences of the same sample userthat are obtained based on the historical behavior data of the user.

For example, a plurality of historical behavior group sequences of auser A is obtained from a user behavior log of the sample user A, andone of the plurality of historical behavior group sequences includes ahistorical query field of the sample user A and an object of a responseoperation of the sample user A in search results corresponding to thehistorical query field. Based on the plurality of historical behaviorgroup sequences of the sample user A, the search recommendation modelcan learn an association relationship between the historical query fieldin the plurality of historical behavior group sequences of the sampleuser A and the object of the historical response operation, to improveaccuracy of the search recommendation model when the sample user Ainputs the current query field.

It should be understood that the sample data in the training sample setmay be data generated based on an operation behavior of a real user, orthe sample data included in the training sample set may be dataconstructed by using an algorithm, that is, the sample data may not begenerated based on an operation behavior of a real user. In a possibleimplementation, the masked sample user behavior group sequence mayindicate that mask processing is performed on an obtained original userbehavior group sequence. For example, a specific proportion of userbehavior group sequences may be randomly sampled from original userbehavior group sequences. For the sampled user behavior group sequence,an operation object of a response behavior of the user is masked. Aspecific mask manner may be replacing an original object with a special‘MASK’ symbol.

With reference to the first aspect, in some implementations of the firstaspect, the search recommendation model predicts the label of thecandidate recommendation object based on the query field input by thetarget user and the historical behavior group sequence of the targetuser. The historical behavior group sequence of the target user isobtained based on the historical query field of the target user and thehistorical behavior data corresponding to the historical query field.The historical behavior data corresponding to the historical query fieldis an object of a response operation performed by the target user on thesearch results corresponding to the historical query field.

With reference to the first aspect, in some implementations of the firstaspect, the sample user behavior group sequence further includesidentification information. The identification information is used toindicate an association relationship between the first query field andthe object of the response operation of the sample user. Theidentification information includes a time identifier.

In a possible implementation, the obtaining of a training sample setincludes: obtaining the first query field and data of the object of theresponse operation of the sample user; and performing binding processingon the first query field and the object of the response operation of thesample user corresponding to the first query field, to obtain the sampleuser behavior group sequence.

In this embodiment, in order that the association relationship betweenthe query field and the response behavior of the user can be learned inthe process of training the search recommendation model, that is, thequery field and the response operation performed by the user on thecandidate recommendation object in the search results corresponding tothe query field can be learned, relatively independent query field datain the user behavior log may be bound to user response field data, toobtain training sample data, that is, a user behavior group sequence.

In a possible implementation, the performing of binding processing onthe first query field and the response operation of the sample usercorresponding to the first query field includes:

adding identification information to the first query field and theobject of the response operation of the sample user corresponding to thefirst query field, where the identification information includes a timeidentifier.

With reference to the first aspect, in some implementations of the firstaspect, the search recommendation model is a bidirectional encoderrepresentations from transformers (BERT) model. The method furtherincludes performing vectorization processing on the sample user behaviorgroup sequence and the masked sample user behavior group sequence, toobtain a vector sequence.

The using of the training sample set as input data includes inputtingthe vector sequence to the BERT model.

In this embodiment, the search recommendation model may be thebidirectional encoder representations from transformers (BERT) model.Further, in order that the search recommendation model can recognize aformat of the training sample set, vectorization processing may beperformed on the data in the training sample set, that is, amulti-element group sequence may be converted into a vector sequence.

With reference to the first aspect, in some implementations of the firstaspect, the response operation of the sample user includes one or moreof a click operation, a download operation, a purchase operation, or abrowse operation of the sample user.

According to a second aspect, a method for sorting search results isprovided, including: obtaining a to-be-processed user behavior groupsequence of a user, where the to-be-processed user behavior groupsequence includes a current query field of the user and a sequenceobtained after mask processing is performed on an object of a responseoperation of the user;

-   inputting the to-be-processed behavior group sequence to a    pre-trained search recommendation model, to obtain a label of a    candidate recommendation object in a candidate recommendation object    set corresponding to the current query field, where the label is    used to indicate a probability that the user performs a response    operation on the candidate recommendation object in the candidate    recommendation object set; and-   obtaining, based on the label of the candidate recommendation    object, sorted search results corresponding to the current query    field, where the search recommendation model is used to predict a    label of a candidate recommendation object in search results    corresponding to a query field when a target user inputs the query    field, the search recommendation model is obtained through using a    training sample set as input data and performing training with a    training target of obtaining an object of a response operation of a    sample user after mask processing, the training sample set includes    a sample user behavior group sequence and a masked sample user    behavior group sequence, the sample user behavior group sequence    includes a first query field and an object of a response operation    of a sample user in search results corresponding to the first query    field, and the masked sample user behavior group sequence includes a    second query field and a sequence obtained after mask processing is    performed on an object of a response operation of the sample user in    search results corresponding to the second query field.

It should be understood that the foregoing sample user behavior groupsequence may be a group of data that is of the sample user and that issorted in a time sequence, for example, behavior log data of the sampleuser.

In a possible implementation, the training sample set may be dataobtained from a user behavior log of the sample user, and includes ahistorical query field of the sample user and a response operation ofthe sample user to a candidate recommendation object in search resultscorresponding to the historical query field, for example, operationsperformed by the sample user on a candidate recommendation object insearch results corresponding to a query field such as a click operation,a download operation, a purchase operation, and a browse operation.

In a possible implementation, the candidate recommendation object may bea document, a service product, an advertisement, or an application.

In a possible implementation, the label of the candidate recommendationobject may be an evaluation score of the candidate recommendation objectcorresponding to the query field. A candidate recommendation object witha higher evaluation score may indicate a higher probability that theuser performs a response operation on the candidate recommendationobject based on historical behavior data of the user. In this case, thecandidate recommendation object may be placed at a front location insearch results.

In this embodiment, the label of the candidate recommendation object inthe candidate recommendation object set corresponding to the currentquery field may be obtained by using the pre-trained searchrecommendation model. The label may be used to indicate a probabilitythat the user performs the response operation on the candidaterecommendation object in the candidate recommendation object set. Thesorted search results corresponding to the current query field areobtained based on the label of the candidate recommendation object. In aprocess of training the search recommendation model, data that includesthe query field of the user and the response operation of the user maybe used, so that the search recommendation model can learn, based onhistorical behavior logs of different users, an association relationshipbetween the query field and the response operation of the user. In otherwords, the search recommendation model in this disclosure can beeffectively trained by using historical behavior data of the user, sothat the trained search recommendation model can predict a label of acandidate recommendation object in search results corresponding to aquery field when the user inputs the query field. A search intention ofthe user can be recognized based on the label of the candidaterecommendation object, to improve sorting accuracy of the searchresults.

In a possible implementation, the masked sample user behavior groupsequence may indicate that mask (MASK) processing is performed on anobtained original user behavior group sequence. For example, a specificproportion of user behavior group sequences may be randomly sampled fromoriginal user behavior group sequences. For the sampled user behaviorgroup sequence, an operation object of a response behavior of the useris masked. A specific mask manner may be replacing an original objectwith a special ‘MASK’ symbol.

With reference to the second aspect, in some implementations of thesecond aspect, the search recommendation model predicts the label of thecandidate recommendation object based on the query field input by thetarget user and the historical behavior group sequence of the targetuser. The historical behavior group sequence of the target user isobtained based on the historical query field of the target user and thehistorical behavior data corresponding to the historical query field.The historical behavior data corresponding to the historical query fieldis an object of a response operation performed by the target user on thesearch results corresponding to the historical query field.

In a possible implementation, the sample user behavior group sequence isobtained through performing binding processing on the first query fieldof the sample user and the object of the response operation of thesample user.

In this embodiment, in order that the association relationship betweenthe query field and the response behavior of the user can be learned inthe process of training the search recommendation model, that is, thequery field and the response operation performed by the user on thecandidate recommendation object in the search results corresponding tothe query field can be learned, relatively independent query field datain the user behavior log may be bound to user response field data, toobtain training sample data, that is, a user behavior group sequence.

In a possible implementation, the sample user behavior group sequence isobtained through adding identification information to the obtained firstquery field of the sample user and the obtained object of the responseoperation of the sample user, where the identification informationincludes a time identifier.

With reference to the second aspect, in some implementations of thesecond aspect, the sample user behavior group sequence further includesidentification information. The identification information is used toindicate an association relationship between the first query field andthe object of the response operation of the sample user. Theidentification information includes a time identifier.

With reference to the second aspect, in some implementations of thesecond aspect, the pre-trained search recommendation model is abidirectional encoder representations from transformers (BERT) model.The training sample set is obtained through performing vectorizationprocessing on the sample user behavior group sequence and the maskedsample user behavior group sequence.

In this embodiment, the search recommendation model may be thebidirectional encoder representations from transformers (BERT) model.Further, in order that the search recommendation model can recognize aformat of the training sample set, vectorization processing may beperformed on the data in the training sample set, that is, amulti-element group sequence may be converted into a vector sequence.

With reference to the second aspect, in some implementations of thesecond aspect, the response operation of the user includes one or moreof a click operation, a download operation, a purchase operation, or abrowse operation of the user.

According to a third aspect, an apparatus for training a searchrecommendation model is provided, including: an obtaining unit,configured to obtain a training sample set, where the training sampleset includes a sample user behavior group sequence and a masked sampleuser behavior group sequence, the sample user behavior group sequenceincludes a first query field and an object of a response operation of asample user in search results corresponding to the first query field,and the masked sample user behavior group sequence includes a secondquery field and a sequence obtained after mask processing is performedon an object of a response operation of the sample user in searchresults corresponding to the second query field; and

a processing unit, configured to: use the training sample set as inputdata, and train a search recommendation model, to obtain the trainedsearch recommendation model, where a training target is to obtain theobject of the response operation of the sample user after the maskprocessing, the search recommendation model is used to predict a labelof a candidate recommendation object in search results corresponding toa query field when a target user inputs the query field, and the labelis used to indicate a probability that the target user performs aresponse operation on the candidate recommendation object.

It should be understood that extension, limitation, explanation, anddescription of related content in the first aspect are also applicableto the same content in the third aspect.

With reference to the third aspect, in some implementations of the thirdaspect, the search recommendation model predicts the label of thecandidate recommendation object based on the query field input by thetarget user and a historical behavior group sequence of the target user.The historical behavior group sequence of the target user is obtainedbased on a historical query field of the target user and historicalbehavior data corresponding to the historical query field. Thehistorical behavior data corresponding to the historical query field isan object of a response operation performed by the target user on thesearch results corresponding to the historical query field.

With reference to the third aspect, in some implementations of the thirdaspect, the sample user behavior group sequence further includesidentification information. The identification information is used toindicate an association relationship between the first query field andthe object of the response operation of the sample user. Theidentification information includes a time identifier.

With reference to the third aspect, in some implementations of the thirdaspect, the search recommendation model is a bidirectional encoderrepresentations from transformers (BERT) model. The processing unit isfurther configured to: perform vectorization processing on the sampleuser behavior group sequence and the masked sample user behavior groupsequence, to obtain a vector sequence.

The processing unit is further configured to input the vector sequenceto the BERT model.

With reference to the third aspect, in some implementations of the thirdaspect, the response operation of the sample user includes one or moreof a click operation, a download operation, a purchase operation, or abrowse operation of the sample user.

According to a fourth aspect, an apparatus for sorting search results isprovided, including: an obtaining unit, configured to obtain ato-be-processed user behavior group sequence of a user, where theto-be-processed user behavior group sequence includes a current queryfield of the user and a sequence obtained after mask processing isperformed on an object of a response operation of the user; and aprocessing unit, configured to: input the to-be-processed behavior groupsequence to a pre-trained search recommendation model, to obtain a labelof a candidate recommendation object in a candidate recommendationobject set corresponding to the current query field, where the label isused to indicate a probability that the user performs a responseoperation on the candidate recommendation object in the candidaterecommendation object set; and obtain, based on the label of thecandidate recommendation object, sorted search results corresponding tothe current query field, where the search recommendation model is usedto predict a label of a candidate recommendation object in searchresults corresponding to a query field when a target user inputs thequery field, the search recommendation model is obtained through using atraining sample set as input data and performing training with atraining target of obtaining an object of a response operation of asample user after mask processing, the training sample set includes asample user behavior group sequence and a masked sample user behaviorgroup sequence, the training sample set includes a sample user behaviorgroup sequence and a masked sample user behavior group sequence, thesample user behavior group sequence includes a first query field and anobject of a response operation of the sample user in search resultscorresponding to the first query field, and the masked sample userbehavior group sequence includes a second query field and a sequenceobtained after mask processing is performed on an object of a responseoperation of the sample user in search results corresponding to thesecond query field.

It should be understood that extension, limitation, explanation, anddescription of related content in the second aspect are also applicableto the same content in the fourth aspect.

With reference to the fourth aspect, in some implementations of thefourth aspect, the search recommendation model predicts the label of thecandidate recommendation object based on the query field input by thetarget user and a historical behavior group sequence of the target user.The historical behavior group sequence of the target user is obtainedbased on a historical query field of the target user and historicalbehavior data corresponding to the historical query field. Thehistorical behavior data corresponding to the historical query field isan object of a response operation performed by the target user on thesearch results corresponding to the historical query field.

With reference to the fourth aspect, in some implementations of thefourth aspect, the sample user behavior group sequence further includesidentification information. The identification information is used toindicate an association relationship between the first query field andthe object of the response operation of the sample user. Theidentification information includes a time identifier.

With reference to the fourth aspect, in some implementations of thefourth aspect, the pre-trained search recommendation model is abidirectional encoder representations from transformers (BERT) model.The training sample set is obtained through performing vectorizationprocessing on the sample user behavior group sequence and the maskedsample user behavior group sequence.

With reference to the fourth aspect, in some implementations of thefourth aspect, the response operation of the user includes one or moreof a click operation, a download operation, a purchase operation, or abrowse operation of the user.

According to a fifth aspect, an apparatus for training a searchrecommendation model is provided, including an input/output interface, aprocessor, and a memory. The processor is configured to control theinput/output interface to send and receive information. The memory isconfigured to store a computer program. The processor is configured to:invoke the computer program from the memory, and run the computerprogram, so that the training apparatus performs the training method inthe first aspect and any possible implementation of the first aspect.

Optionally, the training apparatus may be a terminal device/a server, ormay be a chip in a terminal device/a server.

Optionally, the memory may be located in the processor, for example, maybe a cache in the processor. Alternatively, the memory may be locatedoutside the processor to be independent of the processor, for example,an internal memory of the training apparatus.

According to a sixth aspect, an apparatus for sorting search results isprovided, including an input/output interface, a processor, and amemory. The processor is configured to control the input/outputinterface to send and receive information. The memory is configured tostore a computer program. The processor is configured to: invoke thecomputer program from the memory, and run the computer program, so thatthe apparatus performs the method in the second aspect and any possibleimplementation of the second aspect.

Optionally, the apparatus may be a terminal device/a server, or may be achip in a terminal device/a server.

Optionally, the memory may be located in the processor, for example, maybe a cache in the processor. Alternatively, the memory may be locatedoutside the processor to be independent of the processor, for example,an internal memory of the apparatus.

According to a seventh aspect, a computer program product is provided.The computer program product includes computer program code. When thecomputer program code is run on a computer, the computer is enabled toperform the methods in the foregoing aspects.

It should be noted that all or a part of the foregoing computer programcode may be stored on a first storage medium. The first storage mediummay be encapsulated together with a processor, or may be encapsulatedseparately from a processor. This is not specifically limited inembodiments of the present disclosure.

According to an eighth aspect, a computer-readable medium is provided.The computer-readable medium stores program code. When the computerprogram code is run on a computer, the computer is enabled to performthe methods in the foregoing aspects.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a search system according to anembodiment of the present disclosure;

FIG. 2 is a schematic diagram of system architecture according to anembodiment of the present disclosure;

FIG. 3 is a schematic diagram of a hardware structure of a chipaccording to an embodiment of the present disclosure;

FIG. 4 shows system architecture using a method for training a searchrecommendation model and a method for sorting search results accordingto an embodiment of the present disclosure;

FIG. 5 is a schematic flowchart of a method for training a searchrecommendation model according to an embodiment of the presentdisclosure;

FIG. 6 is a schematic diagram of sequence search architecture based onbidirectional encoder representations from transformers according to anembodiment of the present disclosure;

FIG. 7 is a schematic diagram of a user behavior group sequenceaccording to an embodiment of the present disclosure;

FIG. 8 is a schematic diagram of offline training of a searchrecommendation model according to an embodiment of the presentdisclosure;

FIG. 9 is a schematic flowchart of a method for sorting search resultsaccording to an embodiment of the present disclosure;

FIG. 10 is a schematic diagram of online inference of a searchrecommendation model according to an embodiment of the presentdisclosure;

FIG. 11 is a schematic diagram of search recommendation objects on anapplication store according to an embodiment of the present disclosure;

FIG. 12 is a schematic block diagram of an apparatus for training asearch recommendation model according to an embodiment of the presentdisclosure;

FIG. 13 is a schematic block diagram of an apparatus for sorting searchresults according to an embodiment of the present disclosure;

FIG. 14 is a schematic block diagram of an apparatus for training asearch recommendation model according to an embodiment of the presentdisclosure; and

FIG. 15 is a schematic block diagram of an apparatus for sorting searchresults according to an embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in embodiments of thepresent disclosure with reference to the accompanying drawings inembodiments of the present disclosure. It is clear that the describedembodiments are merely a part rather than all of embodiments of thepresent disclosure. All other embodiments obtained by a person ofordinary skill in the art based on embodiments of the present disclosurewithout creative efforts shall fall within the protection scope of thepresent disclosure.

First, related concepts in embodiments of the present disclosure arebriefly explained.

1. Personalized Search System

The personalized search system is a system that uses a machine learningalgorithm to analyze historical data of a user, predicts a new queryrequest on this basis, and gives personalized search results.

For example, the user inputs a search word A. The personalized searchsystem may analyze historical behavior data of the user by using amachine learning algorithm, and predict an association degree between acommodity in the system and the search word input by the user; andfurther sort commodities in descending order based on the predictedassociation degrees or by using a function of the association degrees.The search system sequentially displays the commodities at differentlocations as search results for the user, and feeds back the searchresults to the user.

2. Offline Training

The offline training is a module, in a personalized recommendationsystem, that iteratively updates parameters of a recommendation modelbased on historical data of the user by using a machine learningalgorithm until a specified requirement is met.

3. Online Inference

The online inference indicates predicting, based on a feature of theuser, a commodity, and a context by using a model trained offline, apreference of the user to a recommended commodity when a current searchword is input, and predicting a probability that the user selects therecommended commodity.

Sequence Search

The sequence search is proposed to meet most search scenarios. It isconsidered that a plurality of query words of the user within a periodof time may be associated with each other. Context information may beused to predict responses of the user to the search results when theuser initiates a new round of search. For example, the user searches asearch system, and performs various operation behavior on feedbacksearch results, for example, query, browsing, clicking, and downloading.Personalized search results may be returned based on the predictedresponses of the user to the search results.

For example, FIG. 1 is a schematic diagram of a search system accordingto an embodiment of the present disclosure.

As shown in FIG. 1 , after the user uses the search system 100, the usermay trigger a search request in the search system 100 (for example, theuser may input a query word that may also be referred to as a searchword). The search system may input the query word and other relatedinformation to a prediction model, and then predict an associationdegree between a commodity in the search system and the query word.Further, commodities may be sorted in descending order based onpredicted association degrees or by using a function of associationdegrees. The search system may sequentially display the commodities atdifferent locations as search results for the user. In this way, theuser may conduct a user behavior on the feedback search results, forexample, browsing, clicking, and downloading. In addition, an actualbehavior of the user is stored in a log as training data. Parameters ofa prediction model are continuously updated by using an offline trainingmodule, to improve a prediction effect of the model.

For example, the user opens an application store on a smart terminal.After a query word is input in a search bar, the search system of theapplication store may be triggered. The search system of the applicationstore predicts, based on the response of the user such as a historicaldownload record of the user and a click record of the user and a featureof an application, for example, environment feature information such asa time and a place, a probability that the user downloads a givenapplication (APP). Based on a calculated result, the search system ofthe application store may display the search results, that is, candidateAPPs in descending order of predicted probability values, to improvedownload probabilities of the candidate APPs.

The smart terminal may be a mobile or fixed terminal device. Forexample, the smart terminal may be a mobile phone, a tablet personalcomputer (TPC), a media player, a smart television, a laptop computer(LC), a personal digital assistant (PDA), or a personal computer (PC).This is not limited in embodiments of the present disclosure.

For example, an APP with a relatively high predicted selectivity of theuser may be displayed at a front location in the search results, and anAPP with a relatively low predicted selectivity of the user may bedisplayed at a back location in the search results.

Further, the responses of the user to the search results are also storedin a log, and the parameters of the prediction model are trained andupdated by using the offline training module.

For example, in an online inference phase, the model may form an inputsequence based on the current query word, a historical query word, and adownload result, and directly output sorted search results.

The search recommendation model and the online inference model in theoffline training may be neural network models. The following describesrelated terms and concepts of a neural network that may be involved inembodiments of the present disclosure.

Neural Network

The neural network may include neurons. The neuron may indicate anoperation unit that uses x_(s) and an intercept 1 as input. Output ofthe operation unit may be as follows:

$h_{W,b}(x) = f\left( {W^{T}x} \right) = f\left( {\sum_{s = 1}^{n}{W_{s}x_{s} + b}} \right)$

Herein, s=1, 2, ..., and n, n is a natural number greater than 1, W_(s)is a weight of x_(s), b is a bias of the neuron, and f is an activationfunction of the neuron, and is used to introduce a nonlinear featureinto the neural network, to convert an input signal in the neuron intoan output signal. The output signal of the activation function may beused as input of a next convolutional layer. The activation function maybe a sigmoid function. The neural network is a network formed byconnecting a plurality of single neurons together. To be specific,output of a neuron may be input for another neuron. An input of eachneuron may be connected to a local receptive field of a previous layerto extract a feature of the local receptive field. The local receptivefield may be a region including several neurons.

Deep Neural Network

The deep neural network (DNN), also referred to as a multi-layer neuralnetwork, may be understood as a neural network including a plurality ofhidden layers. The DNN is divided according to locations of differentlayers. The neural network of the DNN may be divided into three parts:an input layer, a hidden layer, and an output layer. Generally, thefirst layer is the input layer, the last layer is the output layer, andthe middle layer is the hidden layer. The layers are fully connected toeach other. In other words, any neuron at an i^(th) layer must beconnected to any neuron at an (i+1)^(th) layer.

Although the DNN is very complex seemingly, it is not complex for workat each layer. This is simply as the following linear relationalexpression:

$\overset{\rightarrow}{y} = \alpha\left( {W\square\overset{\rightarrow}{x} + \overset{\rightarrow}{b}} \right)$

. Herein,

$\overset{\rightarrow}{x}$

is an input vector,

$\overset{\rightarrow}{y}$

is an output vector,

$\overset{\rightarrow}{b}$

is a bias vector, W is a weight matrix (also referred to as acoefficient), and α( ) is an activation function. At each layer, only asimple operation is performed on the input vector

$\overset{\rightarrow}{x}$

to obtain the output vector

$\overset{\rightarrow}{y}$

. Because the DNN has a plurality of layers, there are also a relativelylarge quantity of coefficients W and bias vectors

$\overset{\rightarrow}{b}$

. Definitions of these parameters in the DNN are as follows: Thecoefficient W is used as an example. It is assumed that the DNN includesthree layers. A linear coefficient from a fourth neuron at a secondlayer to a second neuron at a third layer is defined as

W₂₄³.

The superscript 3 represents a layer at which the coefficient W islocated, and the subscript corresponds to an output third-layer index 2and an input second-layer index 4.

In conclusion, a coefficient from a k^(th) neuron at an (L-1)^(th) layerto a j^(th) neuron at an L^(th) layer is defined as

W_(jk)^(L).

It should be noted that the input layer does not have the parameter W.In the deep neural network, more hidden layers make the network morecapable of describing a complex case in the real world. Theoretically,more parameters indicate a more complex model and a larger “capacity”.This indicates that the model can complete a more complex learning task.A process of training the deep neural network is a process of learning aweight matrix, and a final objective of training is to obtain weightmatrices (weight matrices formed by vectors W at many layers) of alllayers of a trained deep neural network.

7. Loss Function

In a process of training the deep neural network, because it is expectedthat an output of the deep neural network is as much as possible closeto a predicted value that is actually expected, a predicted value of acurrent network and a target value that is actually expected may becompared, and then a weight vector of each layer of the neural networkis updated based on a difference between the predicted value and thetarget value (certainly, there is usually an initialization processbefore the first update, to be specific, parameters are preconfiguredfor all layers of the deep neural network). For example, if thepredicted value of the network is large, the weight vector is adjustedto decrease the predicted value, and adjustment is continuouslyperformed, until the deep neural network can predict the target valuethat is actually expected or a value that is very close to the targetvalue that is actually expected. Therefore, “how to obtain, throughcomparison, a difference between the predicted value and the targetvalue” needs to be predefined. This is a loss function or an objectivefunction. The loss function and the objective function are importantequations that measure the difference between the predicted value andthe target value. The loss function is used as an example. A higheroutput value (loss) of the loss function indicates a larger difference.Therefore, training of the deep neural network is a process ofminimizing the loss as much as possible.

Back Propagation Algorithm

An error back propagation (BP) algorithm may be used in the neuralnetwork to correct a value of a parameter in an initial neural networkmodel in a training process, to reduce a reconstruction error loss ofthe neural network model. An input signal is forward transmitted untilan error loss is generated in an output, and the parameter of theinitial neural network model is updated through back propagation ofinformation about the error loss, to converge the error loss. The backpropagation algorithm is a back propagation motion dominated by an errorloss, and is intended to obtain a parameter of an optimal neural networkmodel, for example, a weight matrix.

FIG. 2 shows system architecture 200 according to an embodiment of thepresent disclosure.

In FIG. 2 , a data collection device 260 is configured to collecttraining data. For a method of training a search recommendation model inembodiments of the present disclosure, the search recommendation modelmay be further trained by using a training sample. In other words, thetraining data collected by the data collection device 260 may be thetraining sample.

For example, in this embodiment, a training sample set may include asample user behavior group sequence and a masked sample user behaviorgroup sequence. The sample user behavior group sequence includes asample query field (for example, a first query field) and an object of aresponse operation of a sample user in search results corresponding tothe sample query field. The masked sample user behavior group sequenceis a sequence obtained after mask processing is performed on the objectof the response operation of the sample user.

After collecting the training data, the data collection device 260stores the training data in a database 230. A training device 220obtains a target model/rule 201 through training based on the trainingdata maintained in the database 230.

The following describes a process in which the training device 220obtains the target model/rule 201 based on the training data. Thetraining device 220 processes an input sample training set, and comparesa truth with an output label of the object of the response operation ofthe sample user after the mask processing, until a difference betweenthe truth and the label that is output by the training device 220 andthat is of the object of the response operation of the sample user afterthe mask processing is less than a specific threshold, to completetraining of the target model/rule 201.

For example, in this embodiment, the training device 220 may train thesearch recommendation model based on the training sample set. Forexample, the training sample set may be used as input data, and trainingmay be performed on the search recommendation model, where a trainingtarget is to obtain the object of the response operation of the sampleuser after the mask processing. Further, the trained searchrecommendation model is obtained. In other words, the trained searchrecommendation model may be the target model/rule 201.

The target model/rule 201 can be used to predict a label of a candidaterecommendation object in search results corresponding to a query fieldwhen the user inputs the query field. The target model/rule 201 in thisembodiment may be a bidirectional encoder representations fromtransformers (BERT) model, or the like.

It should be noted that in actual application, the training datamaintained in the database 230 is not necessarily all collected by thedata collection device 260, and some training data may be received fromanother device.

In addition, it should be noted that the training device 220 may nottrain the target model/rule 201 entirely based on the training datamaintained in the database 230, and may train a model through obtainingtraining data from a cloud or another place. The foregoing descriptionshould not be construed as a limitation to this embodiment.

The target model/rule 201 obtained by the training device 220 throughtraining may be applied to different systems or devices, for example,applied to an execution device 210 shown in FIG. 2 . The executiondevice 210 may be a terminal, for example, a mobile phone terminal, atablet computer, a notebook computer, augmented reality (AR)/virtualreality (VR), or an in-vehicle terminal; or may be a server, a cloudserver, or the like. In FIG. 2 , the execution device 210 is configuredwith an input/output (I/O) interface 212 configured to exchange datawith an external device. A user may input data to the I/O interface 212by using a client device 240. The input data in this embodiment mayinclude a training sample input by a client device.

A preprocessing module 213 and a preprocessing module 214 are configuredto preprocess the input data received by the I/O interface 212. In thisembodiment, there may be no preprocessing module 213 and preprocessingmodule 214 (or there may be only one preprocessing module), and acalculation module 211 is directly used to process the input data.

In a process in which the execution device 210 preprocesses the inputdata, or in a process in which a calculation module 211 of the executiondevice 210 performs calculation or the like, the execution device 210may invoke data, code, and the like in a data storage system 250 forcorresponding processing; and may also store, in a data storage system250, data, instructions, and the like that are obtained through thecorresponding processing.

Finally, an I/O interface 212 returns a processing result. For example,the obtained trained search recommendation model may be used in a searchsystem for online inference of the label of the candidate recommendationobject in the candidate recommendation object set corresponding to thecurrent query field of the user, obtaining sorted search resultscorresponding to the current query field based on the label of thecandidate recommendation object, and returning the sorted search resultsto the client device 240 and then to the user.

It should be noted that the training device 220 may generate, based ondifferent training data, the corresponding target models/rules 201 fordifferent targets or different tasks. The corresponding targetmodels/rules 201 may be used to implement the foregoing targets orcomplete the foregoing tasks, thereby providing a desired result for theuser.

In the case shown in FIG. 2 , in a case, the user may manually giveinput data. The manually giving may be performed by using an interfaceprovided by the I/O interface 212.

In another case, the client device 240 may automatically send the inputdata to the I/O interface 212. If it is required that the client device240 needs to obtain a grant from the user for automatically sending theinput data, the user may set corresponding permission in the clientdevice 240. The user may view, on the client device 240, a result outputby the execution device 210. A specific presentation form may be aspecific manner such as display, voice, or an action. The client device240 may also serve as a data collection end; collect, as new sampledata, the input data that is input to the I/O interface 212 and anoutput result that is output from the I/O interface 212 shown in thefigure; and store the new sample data in the database 230. Certainly,alternatively, the input data that is input to the I/O interface 212 andthe output result that is output from the I/O interface 212 shown in thefigure may be directly stored as new sample data in the database 130 byusing the I/O interface 212, instead of being collected by the clientdevice 240.

It should be noted that FIG. 2 is merely a schematic diagram of systemarchitecture according to an embodiment of the present disclosure, and alocation relationship between a device, a component, a module, and thelike shown in the figure constitutes no limitation. For example, in FIG.2 , the data storage system 250 is an external memory relative to theexecution device 210. In another case, the data storage system 250 mayalternatively be disposed in the execution device 210.

For example, the search recommendation model in the present disclosuremay be a bidirectional encoder representations from transformers (BERT)model, or an enhanced representation through knowledge integration(ERNIE) model, or another model.

FIG. 3 is a schematic diagram of a hardware structure of a chipaccording to an embodiment of the present disclosure.

As shown in FIG. 3 , the chip includes a neural network processing unit300 (NPU). The chip may be disposed in the execution device 210 shown inFIG. 2 , to complete calculation work of the calculation module 211. Thechip may alternatively be disposed in the training device 220 shown inFIG. 2 , to complete training work of the training device 220 and outputthe target model/rule 201.

The neural network processing unit 300 serves as a coprocessor mountedto a host central processing unit (CPU). The host CPU allocates a task.A core part of the NPU 300 is an operation circuit 303. A controller 304controls the operation circuit 303 to extract data from a memory (aweight memory or an input memory) and perform an operation.

In some implementations, the operation circuit 303 includes a pluralityof processing engine (process engine, PE).

In some implementations, the operation circuit 303 is a two-dimensionalsystolic array, or the operation circuit 303 may be a one-dimensionalsystolic array or another electronic circuit that can performarithmetical operations such as multiplication and addition.

In some implementations, the operation circuit 303 is a general-purposematrix processor.

For example, it is assumed that there are an input matrix A, a weightmatrix B, and an output matrix C. The operation circuit 303 extractsdata corresponding to the matrix B from a weight memory 302, and buffersthe data on each PE in the operation circuit 303. The operation circuit303 obtains data of the matrix A from an input memory 301, performs amatrix operation on the data of the matrix A and the matrix B, andstores some results or a final result of an obtained matrix in anaccumulator 308. A vector calculation unit 307 may perform furtherprocessing such as vector multiplication, vector addition, an exponentoperation, a logarithm operation, or value comparison on output of theoperation circuit 303.

For example, the vector calculation unit 307 may be configured toperform network calculation, such as pooling, batch normalization, orlocal response normalization, at a nonconvolution/non-FC layer in aneural network.

In some implementations, the vector calculation unit 307 can store, in aunified memory 306, an output vector that has been processed. Forexample, the vector calculation unit 307 may apply a non-linear functionto the output of the operation circuit 303, for example, to a vector ofan accumulated value, to generate an activation value.

In some implementations, the vector calculation unit 307 generates anormalized value, a combined value, or both.

In some implementations, the output vector that has been processed canbe used as activation input of the operation circuit 303, for example,to be used in a subsequent layer in the neural network.

For example, the unified memory 306 may be configured to store inputdata and output data. For weight data, a direct memory access controller305 (DMAC) stores input data in an external memory to the input memory301 and/or the unified memory 306, store weight data in the externalmemory to the weight memory 302, and store data in the unified memory306 to the external memory.

For example, a bus interface unit (BIU) 310 may be configured toimplement interaction between the host CPU, the DMAC, and an instructionfetch memory 309 by using a bus.

For example, the instruction fetch memory (instruction fetch buffer) 309connected to the controller 304 may be configured to store instructionsused by the controller 304. The controller 304 may be configured toinvoke the instructions buffered in the instruction fetch memory 309, toimplement a working process of controlling an operation accelerator.

Generally, the unified memory 306, the input memory 301, the weightmemory 302, and the instruction fetch memory 309 each may be an on-chipmemory. The external memory is a memory outside the NPU. The externalmemory may be a double data rate synchronous dynamic random accessmemory (DDR SDRAM), a high bandwidth memory (HBM), or another readableand writable memory.

It should be noted that an operation in the search recommendation modelin this embodiment may be performed by the operation circuit 303 or thevector calculation unit 307.

Currently, in a search recommendation system, search results may begenerated through sorting objects in a candidate set by using a sortingfunction of learning associations between objects in a searchword-candidate set. However, only static information of the currentsearch, that is, information of a search word is considered in theforegoing sorting function. Different users obtain the same sortedsearch results when inputting the same search word. In other words,accuracy of the search results obtained based on the current searchrecommendation model is relatively low, and requirements of differentusers cannot be met; and therefore, user experience is relatively poor.

In view of this, in a process of training the search recommendationmodel, data that includes a query field of the user and a responseoperation of the user is used, so that the search recommendation modelcan learn, based on historical behavior logs of different users, anassociation relationship between the query field and the responseoperation of the user. In other words, the search recommendation modelin the present disclosure can be effectively trained by using historicalbehavior data of the user, so that the trained search recommendationmodel can predict a label of a candidate recommendation object in searchresults corresponding to a query field when the user inputs the queryfield. A search intention of the user can be recognized based on thelabel of the candidate recommendation object, to improve accuracy offeedback search results, that is, improve accuracy of the searchrecommendation model.

FIG. 4 shows system architecture using a method for training a searchrecommendation model and a method for sorting search results accordingto an embodiment of the present disclosure. The system architecture 400may include a local device 420, a local device 430, an execution device410, and a data storage system 450. The local device 420 and the localdevice 430 may be connected to the execution device 410 by using acommunication network.

The execution device 410 may be implemented by one or more servers.Optionally, the execution device 410 may be used in cooperation withanother computing device, for example, a device such as a data memory, arouter, or a load balancer. The execution device 410 may be disposed onone physical station or distributed on a plurality of physical stations.The execution device 410 may use data in the data storage system 450, orinvoke program code in the data storage system 450 to implement themethod for training a search recommendation model and the method forsorting search results in embodiments of the present disclosure.

For example, the data storage system 450 may be deployed in the localdevice 420 or the local device 430. For example, the data storage system450 may be configured to store a behavior log of a user.

It should be noted that the execution device 410 may also be referred toas a cloud device. In this case, the execution device 410 may bedeployed in a cloud.

The execution device 410 may perform the following processes: obtaininga training sample set, where the training sample set includes a sampleuser behavior group sequence and a masked sample user behavior groupsequence, the sample user behavior group sequence includes a first queryfield and an object of a response operation of a sample user in searchresults corresponding to the first query field, and the masked sampleuser behavior group sequence includes a second query field and asequence obtained after mask processing is performed on an object of aresponse operation of the sample user in search results corresponding tothe second query field; and using the training sample set as input data,and training the search recommendation model, to obtain the trainedsearch recommendation model, where a training target is to obtain theobject of the response operation of the sample user after the maskprocessing, the search recommendation model is used to predict a labelof a candidate recommendation object in search results corresponding toa query field when a target user inputs the query field, and the labelis used to indicate a probability that the target user performs aresponse operation on the candidate recommendation object.

In the foregoing processes, the execution device 410 can obtain thepre-trained search recommendation model through training. The searchrecommendation model can be effectively trained based on historicalbehavior data of the user, so that the trained search recommendationmodel can predict the label of the candidate recommendation object inthe search results corresponding to the query field based on a hobby ofthe user when the user inputs the query field.

In a possible implementation, the training method performed by theexecution device 410 may be an offline training method performed in thecloud.

For example, the user may store an operation log to the data storagesystem 450 after operating respective user equipment (for example, thelocal device 420 and the local device 430). The execution device 410 mayinvoke the data in the data storage system 450 to complete the processof training the search recommendation model. Each local device mayrepresent any computing device, for example, a personal computer, acomputer work station, a smartphone, a tablet computer, a smart camera,a smart car, another type of cellular phone, a media consumption device,a wearable device, a set top box, or a game machine. A local device ofeach user may interact with the execution device 410 by using acommunication network of any communication mechanism/communicationstandard. The communication network may use a manner of a wide areanetwork, a local area network, a point-to-point connection, or anycombination thereof.

In an implementation, the local device 420 and the local device 430 mayobtain related parameters of the pre-trained search recommendation modelfrom the execution device 410, and use the search recommendation model.The label of the candidate recommendation object in the search resultscorresponding to the query field is predicted by using the searchrecommendation model when the user inputs the query field. The label mayindicate whether the user performs the response operation on thecandidate recommendation object, for example, whether the user clicksthe candidate recommendation object.

In another implementation, the pre-trained search recommendation modelmay be directly deployed on the execution device 410. The executiondevice 410 obtains the to-be-processed user behavior group sequence fromthe local device 420 and the local device 430, and obtains, by using thepre-trained search recommendation model, the label of the candidaterecommendation object in the candidate recommendation object setcorresponding to the current query field.

For example, the data storage system 450 may be deployed in the localdevice 420 or the local device 430, and configured to store a behaviorlog of the user of the local device.

For example, the data storage system 450 may be independent of the localdevice 420 or the local device 430, and is independently deployed on astorage device. The storage device may interact with the local device,obtain the behavior log of the user in the local device, and store thebehavior log in the storage device.

The following describes embodiments of the present disclosure in detailwith reference to FIG. 5 to FIG. 11 .

FIG. 5 is a schematic flowchart of a method for training a searchrecommendation model according to an embodiment of the presentdisclosure. The training method 500 shown in FIG. 5 includes step 510and step 520. The following separately describes step 510 and step 520in detail.

Step 510: Obtain a training sample set.

The training sample set may include a sample user behavior groupsequence and a masked sample user behavior group sequence. The sampleuser behavior group sequence may include a first query field and anobject of a response operation of a sample user in search resultscorresponding to the first query field. The masked sample user behaviorgroup sequence is a sequence obtained after mask processing is performedon the object of the response operation of the sample user. For example,the masked sample user behavior group sequence may include a secondquery field and a sequence obtained after mask processing is performedon an object of a response operation of the sample user in searchresults corresponding to the second query field.

It should be understood that the foregoing sample user behavior groupsequence may be a group of data that is of the sample user and that issorted in a time sequence, for example, behavior log data of the sampleuser.

For example, the training sample set may be data obtained from the datastorage system 450 shown in the figure.

For example, as shown in FIG. 1 , the training sample set may be dataobtained from a user behavior log of the sample user, and includes ahistorical query field of the sample user and a response operation ofthe sample user to a candidate recommendation object in search resultscorresponding to the historical query field, for example, operationsperformed by the sample user on a candidate recommendation object insearch results corresponding to a search field such as a clickoperation, a download operation, a purchase operation, and a browseoperation. It should be understood that the sample user behavior groupsequence may include the first query field and the object of theresponse operation of the sample user in the search resultscorresponding to the first query field. There is an associationrelationship between the first query field and the object of theresponse operation of the sample user in the search results. Forexample, when the sample user inputs a query field, the sample userobtains search results corresponding to the sample field. The searchresults may include a plurality of candidate recommendation objectsassociated with the query field. Further, the sample user may perform aresponse operation on the candidate recommendation object included inthe search results based on a hobby and a requirement of the sampleuser, for example, click, download, purchase, or browse some or all ofcandidate objects in the search results, to generate data of theresponse operation of the sample user and store the data in the behaviorlog of the sample user. For example, the object of the responseoperation of the user may be a document, a service product, anadvertisement, an application, or the like. The response operation ofthe user includes one or more of a click operation, a downloadoperation, a purchase operation, or a browse operation of the user.

Further, in this embodiment, in order that the association relationshipbetween a query field and a response behavior of the user can be learnedin the process of training the search recommendation model, that is, thequery field and the response operation performed by the user on thecandidate recommendation object in the search results corresponding tothe query field can be learned, relatively independent query field datain the user behavior log may be bound to user response field data, toobtain training sample data, that is, a user behavior group sequence.

Optionally, in a possible implementation, the obtaining a trainingsample set includes: obtaining the first query field and data of theobject of the response operation of the sample user; and performingbinding processing on the first query field and the object of theresponse operation of the sample user corresponding to the first queryfield, to obtain the sample user behavior group sequence.

For example, the sample user behavior group sequence further includesidentification information. The identification information is used toindicate an association relationship between the first query field andthe object of the response operation of the sample user. Theidentification information includes a time identifier.

For example, as shown in FIG. 7 , the sample user behavior groupsequence may be a sequence including four training samples. Eachtraining sample may include a time identifier, a query field, and anobject of a response operation of the user (for example, a clickedobject and a downloaded object). A function of the time identifier maybe an identifier of binding a query field to an object of a responseoperation of the user corresponding to the query field.

For example, the masked sample user behavior group sequence may indicatethat mask processing is performed on an obtained original user behaviorgroup sequence. For example, a specific proportion of user behaviorgroup sequences may be randomly sampled from original user behaviorgroup sequences. For the sampled user behavior group sequence, anoperation object of a response behavior of the user is masked. Aspecific mask manner may be replacing an original object with a special‘MASK’ symbol.

For example, as shown in FIG. 8 , a clicked object c3 and a downloadedobject d3 in a user behavior group sequence with a time identifier t3are masked to generate a corresponding masked user behavior groupsequence.

Step 520: Use the training sample set as input data, and train a searchrecommendation model, to obtain the trained search recommendation model,where a training target is to obtain the object of the responseoperation of the sample user after the mask processing.

The search recommendation model is used to predict a label of acandidate recommendation object in search results corresponding to aquery field when a target user inputs the query field. The label may beused to indicate whether the target user performs a response operationon the candidate recommendation object.

For example, the label of the candidate recommendation object may be anevaluation score of the candidate recommendation object corresponding tothe query field. A candidate recommendation object with a higherevaluation score may indicate a higher probability that the userperforms a response operation on the candidate recommendation objectbased on historical behavior data of the user. In this case, thecandidate recommendation object may be placed at a front location in thesearch results.

Optionally, in a possible implementation, the search recommendationmodel predicts the label of the candidate recommendation object based onthe query field input by the target user and the historical behaviorgroup sequence of the target user. The historical behavior groupsequence of the target user is obtained based on the historical queryfield of the target user and the historical behavior data correspondingto the historical query field. The historical behavior datacorresponding to the historical query field is an object of a responseoperation performed by the target user on the search resultscorresponding to the historical query field.

In this embodiment, the search recommendation model can be effectivelytrained by using the historical behavior data of the user, so that thetrained search recommendation model can predict the label of thecandidate recommendation object in the search results corresponding tothe query field when the user inputs the query field. A search intentionof the user can be recognized based on the label of the candidaterecommendation object, to improve sorting accuracy of the searchresults.

For example, in this embodiment, the search recommendation model may bethe bidirectional encoder representations from transformers (BERT)model. Further, in order that the search recommendation model canrecognize a format of the training sample set, vectorization processingmay be performed on data in the training sample set, that is, amulti-element group sequence may be converted into a vector sequence.

Optionally, in a possible implementation, the search recommendationmodel may be a bidirectional encoder representations from transformers(BERT) model. The training method further includes: performingvectorization processing on the sample user behavior group sequence andthe masked sample user behavior group sequence included in the trainingsample set, to obtain a vector sequence. The using the training sampleset as input data includes: inputting the vector sequence to the BERTmodel.

For example, the query field in the user behavior group sequence and theobject of the response operation may be converted into a dense vector. Aquery object is the query field, and the object of the responseoperation is a search result selected by the user. In the foregoingvectorization processing process, a vector of an object needs to beadded to a corresponding behavior group vector and a behavior typevector, to fully express the current user behavior group sequence.

For example, description is provided by using an example in which theuser behavior group sequence is g1{time stamp:t1, query:q1,click:{c11,c12}, download:{d11}}. The user behavior group sequence afterformat processing may be as follows:

$\begin{array}{l}{\text{Vector}\left( \text{q1} \right)\text{=word2vect}\left( \text{q1} \right)\text{+group\_embedding}\left( \text{t1} \right)} \\{\text{+action\_embedding}\left( \text{query} \right)} \\{\text{Vector}\left( \text{c11} \right)\text{=item\_embedding}\left( \text{c11} \right)\text{+group\_embedding}\left( \text{t1} \right)} \\{\text{+action\_embedding}\left( \text{click} \right)} \\{\text{Vector}\left( {\text{d}11} \right) = \text{item}\_\text{embedding}\left( {\text{d}11} \right) +} \\{\text{group}\_\text{embedding}\left( {\text{d}11} \right) + \text{action}\_\text{embedding}\left( \text{downl} \right)\left( \text{oad} \right)}\end{array}$

Herein, word2vec() indicates a word vector conversion function,group_embedding() indicates a group embedding vector compositionfunction, action_embedding() indicates a behavior embedding vectorcomposition function, and item_embedding () indicates an item embeddingvector composition function.

In this embodiment, in the process of training the search recommendationmodel, data that includes the query field of the user and the responseoperation of the user may be used, so that the search recommendationmodel can learn, based on historical behavior logs of different users,an association relationship between the query field and the responseoperation of the user. In other words, the search recommendation modelin the present disclosure can be effectively trained by using thehistorical behavior data of the user, so that the trained searchrecommendation model can predict a label of a candidate recommendationobject in search results corresponding to a query field when the userinputs the query field. A search intention of the user can be recognizedbased on the label of the candidate recommendation object, to improveaccuracy of feedback search results, that is, improve accuracy of thesearch recommendation model.

FIG. 6 is a schematic diagram of sequence search architecture based onbidirectional encoder representations from transformers according to anembodiment of the present disclosure.

As shown in FIG. 6 , the sequence search architecture 600 includes auser historical behavior log 601, a user multi-behavior-sequencealignment and behavior group sequence generating module 602, and a userbehavior sequence modeling module 603 based on bidirectional encoderrepresentations from transformers. The sequence search architecture canmore accurately capture a hobby of a user through jointly modeling auser historical query sequence and a user response sequence to a queryresult, to output search results more consistent with an individualpreference of the user in the future.

For example, the user historical query sequence and a user historicalresponse sequence may be obtained from the user historical behavior log601. The user historical query sequence is a sequence formed throughsorting query fields input by the user in a search box in a timesequence. The user historical response sequence is a sequence formedthrough sorting response behavior of the user for search resultsdisplayed on a platform in a time sequence. For example, the responsebehavior of the user may include but are not limited to an action thatreflects a tendency of a hobby of the user, such as click, download, orpurchase.

The user multi-behavior-sequence alignment and behavior group sequencegenerating module 602 is configured to: perform alignment processing onthe user historical query sequence and the user historical responsesequence, and output a user behavior group sequence after the alignment.The alignment processing is to obtain an association relationshipbetween the user historical query sequence and the user historicalresponse sequence that are obtained from the user historical behaviorlog 601.

It should be understood that the user historical query sequence or theuser historical response sequence that is included in the userhistorical behavior log 601 may be relatively independent data. However,the user historical response sequence is a user response correspondingto a search result fed back after the user inputs a specific query word.Therefore, there is the association relationship between the userhistorical query sequence and the user historical response sequence. Theforegoing alignment processing may be used to obtain the associationrelationship between the user historical query sequence and the userhistorical response sequence in data of the user behavior log.

For example, if a user historical query sequence A is obtained from theuser historical behavior log 601, performing alignment between the userhistorical query sequence and the user historical response sequenceindicates obtaining a user historical response sequence A correspondingto the user historical query sequence A. In other words, the userhistorical response sequence A indicates a response behavior of the userto a search result that corresponds to a query field A and that isdisplayed on the platform after the user inputs the query field A in thesearch box.

For example, FIG. 7 is a schematic diagram of a user behavior groupsequence according to an embodiment of the present disclosure. As shownin FIG. 7 , each user behavior group sequence may be obtained afteralignment processing is performed on the user historical query sequenceand the user historical response sequence. Each element of the userbehavior group sequence may be one N-tuple. The N-tuple may describe onecomplete search behavior of the user, for example, a query field used bythe user and a response of the user to a corresponding search result.For example, the response of the user may include click, download,browse, or purchase. An operation object of the response behavior shownin FIG. 7 may be a document, a service product, an advertisement, anapplication, or the like.

In this embodiment, as shown in FIG. 7 , a user query sequence may bebound to a user response sequence by using a time stamp, to generate onepiece of training sample data.

The user behavior sequence modeling module 603 based on thebidirectional encoder representations from transformers is configuredto: receive output of the user multi-behavior-sequence alignment andbehavior group sequence generating module 602, and model the userbehavior group sequence based on the bidirectional encoderrepresentations from transformers, to obtain a search recommendationmodel. In other words, when the user inputs a query word, search resultscan be obtained by using the search recommendation model based on thepreference of the user. In this case, in the search results, based onhistorical behavior of the user, a recommended object in which the usermay be interested and to which the user may respond (for example, click)may be placed at a front location in the search results, and arecommended object in which the user may not be interested may be placedat a back location of the search results.

The following describes in detail a procedure of offline training andonline inference of the search recommendation model with reference toFIG. 8 and FIG. 9 .

Offline Training Phase

FIG. 8 is a schematic flowchart of offline training of a searchrecommendation model according to an embodiment of the presentdisclosure. The training method 700 shown in FIG. 8 includes step S701to step S704. The following separately describes step S701 to step S704in detail.

It should be noted that the offline training process of the searchrecommendation model shown in FIG. 8 may be performed by the userbehavior sequence modeling module 603 based on bidirectional encoderrepresentations from transformers shown in FIG. 7 .

S701: Perform mask processing on a user behavior group sequence.

For example, mask processing may be performed on an obtained originaluser behavior group sequence. For example, a specific proportion of userbehavior group sequences may be randomly sampled from original userbehavior group sequences. For the sampled user behavior group sequence,an operation object of a response behavior of the user is masked. Aspecific mask manner may be replacing an original object with a special‘MASK’ symbol.

It should be understood that a training target of the searchrecommendation model is to recover the masked original object in theuser behavior group sequence.

The original user behavior group sequence may be a user behavior groupsequence obtained based on a user query sequence and a user historicalresponse sequence. In other words, the user behavior group sequenceshown in FIG. 7 may be used. Alternatively, the original user behaviorgroup sequence may be a user behavior group sequence output by the usermulti-behavior-sequence alignment and behavior group sequence generatingmodule 602 shown in FIG. 6 .

For example, as shown in FIG. 8 , after mask processing is performed onthe original user behavior group sequence, a user behavior responsecorresponding to a time identifier t3 may be masked.

S702: Perform vectorization processing on the user behavior groupsequence.

The vectorization processing performed on the user behavior groupsequence indicates performing format processing on the user behaviorgroup sequence after the mask processing, and converting the userbehavior group sequence to a format that can be processed by abidirectional encoder representations from transformers (BERT) model.

For example, a query behavior in the user behavior group sequence and anoperation object in a response behavior sequence may be converted into adense vector. An operation object of a query behavior is the queryfield, and an operation object of a response behavior is a search resultselected by the user. In the foregoing vectorization process, a vectorof an operation object needs to be added to a corresponding behaviorgroup vector and a behavior type vector, to fully express the currentuser behavior group sequence.

For example, description is provided by using an example in which theuser behavior group sequence is g1{time stamp:t1, query:q1,click:{c11,c12}, download:{d11}}. The user behavior group sequence afterformat processing may be as follows:

$\begin{array}{l}{\text{Vector}\left( \text{q1} \right)\text{=word2vect}\left( \text{q1} \right)\text{+}} \\{\text{group\_embedding}\left( \text{t1} \right)\text{+action\_embedding}\left( \text{query} \right)} \\{\text{Vector}\left( \text{c11} \right) = \text{item\_embedding}\left( \text{c11} \right) + \text{group\_embedding}\left( \text{t1} \right) +} \\{\text{action\_embedding}\left( \text{click} \right)} \\{\text{Vector}\left( \text{d1} \right)\text{=item>embedding}\left( \text{d11} \right)\text{+group\_embedding}\left( \text{t1} \right)\text{+}} \\{\text{action>embedding}\left( \text{downl} \right)\left( \text{oad} \right)}\end{array}$

Herein, word2vec() indicates a word vector conversion function,group_embedding() indicates a group embedding vector compositionfunction, action_embedding() indicates a behavior embedding vectorcomposition function, and item_embedding () indicates an item embeddingvector composition function.

The format processing performed on the user behavior group sequence maybe converting the user behavior group sequence g1 into four vectors:Vector (q1), Vector (c11), Vector (c12), and Vector (d11).

S703: Train the search recommendation model. For example, the searchrecommendation model may be a bidirectional encoder representations fromtransformers model.

For example, the vector that is obtained after the mask processing andthat is output in step S702 is training data, so that the searchrecommendation model learns association relationships between differentuser behavior group sequence points and updates a vector representationof each sequence group. A training target of the search recommendationmodel is to recover the masked original object in the user behaviorgroup sequence.

For example, a vector sequence obtained after the vectorizationprocessing is performed on the user behavior group sequence is input tothe search recommendation model. The search recommendation model maygenerate a random vector for a vector at a mask location in the trainingprocess, and continuously perform back update on model parameters of thesearch recommendation model based on a difference between a truth labeland a label of the object at the mask location, that is, continuouslyupdate an input vector sequence. Because an interaction is implementedbetween the vector at the mask location and a vector at anotherlocation, the input vector sequence is continuously updated in thetraining process. The training target is to make the label that is ofthe vector at the mask location and that is output by the searchrecommendation model, be continuously close to the truth label at thelocation. After the search recommendation model is trained, informationof a historical behavior group sequence of the user is stored in thesevectors.

S704: Calculate a loss function of the search recommendation model.

For example, a loss value for self-recovery of the object at the masklocation is calculated, to determine that iterative training isperformed on the search recommendation model. Model parameters of thesearch recommendation model may be trained based on the loss value.

For example, a vector representation that corresponds to the object inthe mask location and that is output by the model may be obtained. Thetraining target is to continuously update model parameters of a searchrecommendation model, to maximize an inner product of a vectorrepresentation at the mask location and an embedding vector of an actualcorresponding operation object and minimize an inner product of thevector representation and an embedding vector of another object, so thatthe training process is completed for the search training model.

In this embodiment, in the process of training the search recommendationmodel, data that includes the query field of the user and the responseoperation of the user may be used, so that the search recommendationmodel can learn, based on historical behavior logs of different users,an association relationship between the query field and the responseoperation of the user. In other words, the search recommendation modelin the present disclosure can be effectively trained by using historicalbehavior data of the user, so that the trained search recommendationmodel can predict a label of a candidate recommendation object in searchresults corresponding to a query field when the user inputs the queryfield. A search intention of the user can be recognized based on thelabel of the candidate recommendation object, to improve accuracy offeedback search results, that is, improve accuracy of the searchrecommendation model.

Online Inference Phase

FIG. 9 is a schematic diagram of online inference of a searchrecommendation model according to an embodiment of the presentdisclosure.

As shown in FIG. 9 , a query field currently input by a user isobtained. A to-be-predicted operation object of a user behavior isreplaced with a ‘MASK’ symbol, to generate input data obtained aftermask processing. Format processing is performed on the input data toobtain an input vector representation. An operation of obtaining aninner product is performed on an input vector and an embedding vector ofa candidate set object, to obtain a final search result, that is, sortedsearch results.

FIG. 10 is a schematic flowchart of a method for sorting search resultsaccording to an embodiment of the present disclosure.

The method 800 shown in FIG. 10 includes step S810 to step S830. Thefollowing describes step S810 to step S830 in detail.

S810: Obtain a to-be-processed user behavior group sequence of a user.

The to-be-processed user behavior group sequence includes a currentquery field of the user and a sequence obtained after mask processing isperformed on an object of a response operation of the user.

For example, as shown in FIG. 9 , when the user inputs the current queryfield, that is, a latest query field, a recommended object to beresponded to by the user in search results corresponding to the currentquery field is not known. Therefore, the object of the responseoperation of the user may be replaced with a ‘MASK’ symbol, to generatethe to-be-processed user behavior group sequence.

S820: Input the to-be-processed behavior group sequence to a pre-trainedsearch recommendation model, to obtain a label of a candidaterecommendation object in a candidate recommendation object setcorresponding to the current query field.

The label may be used to indicate a probability that the user performs aresponse operation on the candidate recommendation object in thecandidate recommendation object set.

S830: Obtain, based on the label of the candidate recommendation object,sorted search results corresponding to the current query field.

The search recommendation model is used to predict a label of acandidate recommendation object in search results corresponding to aquery field when a target user inputs the query field. The searchrecommendation model is obtained through using a training sample set asinput data and performing training with a training target of obtainingan object of a response operation of a sample user after maskprocessing. The training sample set includes a sample user behaviorgroup sequence and a masked sample user behavior group sequence. Thesample user behavior group sequence includes a first query field and anobject of a response operation of a sample user in search resultscorresponding to the first query field. The masked sample user behaviorgroup sequence includes a second query field and a sequence obtainedafter mask processing is performed on an object of a response operationof the sample user in search results corresponding to the second queryfield.

For example, the candidate recommendation object may be a document, aservice product, an advertisement, or an application.

For example, the response operation of the user includes one or more ofa click operation, a download operation, a purchase operation, or abrowse operation performed by the user on a candidate recommendationobject.

It should be noted that the trained search recommendation model isobtained through pre-training the search model by using the trainingmethod shown in FIG. 5 or FIG. 8 . When the user inputs the currentquery field, that is, when the user inputs the latest query field, theobtained to-be-processed user behavior group sequence may be input tothe pre-trained search recommendation model. The pre-trained searchrecommendation model may output a label of a recommended object in acandidate recommendation set corresponding to the current field for theuser. Whether the user performs a response operation on the candidaterecommendation object in the candidate recommendation set may bepredicted based on the label of the candidate recommendation object. Forexample, whether the user clicks the candidate recommendation object maybe predicted. Further, candidate recommendation objects in the candidaterecommendation set may be sorted based on labels of the candidaterecommendation objects to obtain sorted search results.

For example, the label of the candidate recommendation object may be anevaluation score of the candidate recommendation object corresponding tothe query field. A candidate recommendation object with a higherevaluation score may indicate a higher probability that the userperforms a response operation on the candidate recommendation objectbased on historical behavior data of the user. In this case, thecandidate recommendation object may be placed at a front location insearch results.

It should be noted that the sample user behavior group sequence mayinclude the first query field and the object of the response operationof the sample user in the search results corresponding to the firstquery field. There is an association relationship between the firstquery field and the object of the response operation of the sample userin the search results. For example, when the sample user inputs a queryfield, the sample user obtains search results corresponding to thesample field. The search results may include a plurality of candidaterecommendation objects associated with the query field. Further, thesample user may perform a response operation on the candidaterecommendation object included in the search results based on a hobbyand a requirement of the sample user, for example, click, download,purchase, or browse some or all of the candidate objects in the searchresults, to generate data of the response operation of the sample userand store the data in the behavior log of the sample user. In thisembodiment, in order that the association relationship between the queryfield and the response behavior of the user can be learned in theprocess of training the search recommendation model, that is, the queryfield and the response operation performed by the user on the candidaterecommendation object in the search results corresponding to the queryfield can be learned, relatively independent query field data in theuser behavior log may be bound to user response field data, to obtaintraining sample data, that is, a user behavior group sequence.

Optionally, in a possible implementation, the sample user behavior groupsequence further includes identification information. The identificationinformation is used to indicate an association relationship between thefirst query field and the object of the response operation of the sampleuser. The identification information includes a time identifier.

For example, as shown in FIG. 7 , the sample user behavior groupsequence may be a sequence including four training samples. Eachtraining sample may include a time identifier, a query field, and aresponse operation of the user (for example, click and download). Afunction of the time identifier may be an identifier of binding a queryfield to a response operation of the user corresponding to the queryfield.

Optionally, in a possible implementation, the search recommendationmodel predicts the label of the candidate recommendation object based onthe query field input by the target user and the historical behaviorgroup sequence of the target user. The historical behavior groupsequence of the target user is obtained based on the historical queryfield of the target user and the historical behavior data correspondingto the historical query field. The historical behavior datacorresponding to the historical query field is an object of a responseoperation performed by the target user on the search resultscorresponding to the historical query field.

In this embodiment, the search recommendation model can be effectivelytrained by using the historical behavior data of the user, so that thetrained search recommendation model can predict the label of thecandidate recommendation object in the search results corresponding tothe query field when the user inputs the query field. A search intentionof the user can be recognized based on the label of the candidaterecommendation object, to improve sorting accuracy of the searchresults.

Optionally, in a possible implementation, the pre-trained searchrecommendation model is a bidirectional encoder representations fromtransformers (BERT) model. The training sample set is obtained throughperforming vector processing on the sample user behavior group sequenceand the masked sample user behavior group sequence.

In this embodiment, the search recommendation model may be thebidirectional encoder representations from transformers (BERT) model.Further, in order that the search recommendation model can recognize aformat of the training sample set, vector processing may be performed ondata in the training sample set, that is, a multi-element group sequencemay be converted into a vector sequence.

In this embodiment, the label of the candidate recommendation object inthe candidate recommendation object set corresponding to the currentquery field may be obtained by using the pre-trained searchrecommendation model. The label may be used to indicate a probabilitythat the user performs the response operation on the candidaterecommendation object in the candidate recommendation object set. Thesorted search results corresponding to the current query field areobtained based on the label of the candidate recommendation object. In aprocess of training the search recommendation model, data that includesthe query field of the user and the response operation of the user maybe used, so that the search recommendation model can learn, based onhistorical behavior logs of different users, an association relationshipbetween the query field and the response operation of the user. In otherwords, the search recommendation model in the present disclosure can beeffectively trained by using historical behavior data of the user, sothat the trained search recommendation model can predict a label of acandidate recommendation object in search results corresponding to aquery field when the user inputs the query field. A search intention ofthe user can be recognized based on the label of the candidaterecommendation object, to improve sorting accuracy of the searchresults.

FIG. 11 is a schematic diagram of search recommendation objects on anapplication store according to an embodiment of the present disclosure.

As shown in FIG. 11 , a user opens the application store on a smartterminal, and may input a current search term “single-player game” (forexample, a query field) in a search box. After a search is performed byusing a search word, returned search results may be obtained. Forexample, the search results may include App1, App2, App3, and App4. Theuser may click App2 in the search results. In this case, data of aresponse operation performed by the user may be stored in a userbehavior log. Next, when the user inputs the same search word in thesearch box of the application store, newly displayed sorted searchresults are shown in FIG. 11 . Herein, App2" may be placed at a frontlocation, where App2" may represent the same App as App2, or mayrepresent the same type of App as App2.

It should be noted that a process in which the user inputs the searchword in the search box may be that the user inputs the search word in avoice manner. Alternatively, the user may manually input the search wordon a screen of the smart terminal. This is not limited in embodiments ofthe present disclosure.

For example, a search term “single-player game” is used as an examplefor description. If the user once clicks the “Plants vs. Zombies 2”, thesearch recommendation model provided in this embodiment is used to placethe “Plants vs. Zombies: All Stars” at a front location in the searchresults next time the user inputs the “single-player game” or a searchword similar to a “word game”. Alternatively, if the user once clicksthe “single-player game: Fight the Landlords (happy version)”, thesearch recommendation model provided in this embodiment places the “Junesingle-player game: Fight the Landlords” at a front location in searchresults next time the user inputs the “single-player game” or the searchword similar to the “word game”. Alternatively, if the user once clicksthe “single-player link game”, the search recommendation model providedin this embodiment places the “Anipop” at a front location in searchresults next time the user inputs the “single-player game” or the searchword similar to the “word game”. Similarly, if a category of an App thatthe user clicks at this time changes, a change of a recent hobby of theuser can be captured by using the search recommendation model in thepresent disclosure, to obtain dynamically adjusted sorted searchresults.

It should be understood that the foregoing is an example description,and the search results that correspond to the search word and that arereturned by the application store are not limited to the foregoingexample description.

It should be understood that the following example descriptions aremerely intended to help a person skilled in the art understandembodiments of the present disclosure, instead of limiting embodimentsof the present disclosure to a specific value or a specific scenarioshown in the examples. A person skilled in the art definitely can makevarious equivalent modifications or changes based on the examplesdescribed above, and such modifications or changes also fall within thescope of embodiments of the present disclosure.

The foregoing describes in detail the method for training a searchrecommendation model and a method for sorting search results inembodiments of the present disclosure with reference to FIG. 1 to FIG.11 . The following describes in detail apparatus embodiments in thepresent disclosure with reference to FIG. 12 to FIG. 15 .

It should be understood that the training apparatus in this embodimentmay perform the method for training a search recommendation model inembodiments of the present disclosure, and the apparatus for sortingsearch results may perform the method for sorting search results inembodiments of the present disclosure. For a specific working process ofthe following products, refer to a corresponding process in theforegoing method embodiments.

FIG. 11 is a schematic block diagram of an apparatus for training asearch recommendation model according to an embodiment of the presentdisclosure.

It should be understood that the training apparatus 900 may perform themethod for training a search recommendation model shown in FIG. 5 . Thetraining apparatus 900 includes an obtaining unit 910 and a processingunit 920.

The obtaining unit 910 is configured to obtain a training sample set.The training sample set includes a sample user behavior group sequenceand a masked sample user behavior group sequence. The sample userbehavior group sequence includes a first query field and an object of aresponse operation of a sample user in search results corresponding tothe first query field. The masked sample user behavior group sequenceincludes a second query field and a sequence obtained after maskprocessing is performed on an object of a response operation of thesample user in search results corresponding to the second query field.The processing unit 920 is configured to: use the training sample set asinput data, and train a search recommendation model, to obtain thetrained search recommendation model, where a training target is toobtain the object of the response operation of the sample user after themask processing. The search recommendation model is used to predict alabel of a candidate recommendation object in search resultscorresponding to a query field when a target user inputs the queryfield. The label is used to indicate a probability that the target userperforms a response operation on the candidate recommendation object.

Optionally, in an embodiment, the search recommendation model predictsthe label of the candidate recommendation object based on the queryfield input by the target user and the historical behavior groupsequence of the target user. The historical behavior group sequence ofthe target user is obtained based on the historical query field of thetarget user and the historical behavior data corresponding to thehistorical query field. The historical behavior data corresponding tothe historical query field is an object of a response operationperformed by the target user on the search results corresponding to thehistorical query field.

Optionally, in an embodiment, the sample user behavior group sequencefurther includes identification information. The identificationinformation is used to indicate an association relationship between thefirst query field and the object of the response operation of the sampleuser. The identification information includes a time identifier.

Optionally, in an embodiment, the search recommendation model is abidirectional encoder representations from transformers (BERT) model.The processing unit 920 is further configured to: perform vectorizationprocessing on the sample user behavior group sequence and the maskedsample user behavior group sequence, to obtain a vector sequence.

The processing unit 920 is further configured to input the vectorsequence to the BERT model.

Optionally, in an embodiment, the response operation of the sample userincludes one or more of a click operation, a download operation, apurchase operation, or a browse operation of the sample user.

FIG. 12 is a schematic block diagram of an apparatus for sorting searchresults according to an embodiment of the present disclosure.

It should be understood that the apparatus 1000 may perform the methodfor sorting search results shown in FIG. 10 . The apparatus 1000includes an obtaining unit 1010 and a processing unit 1020.

The obtaining unit 1010 is configured to obtain a to-be-processed userbehavior group sequence of a user. The to-be-processed user behaviorgroup sequence includes a current query field of the user and a sequenceobtained after mask processing is performed on an object of a responseoperation of the user. The processing unit 1020 is configured to: inputthe to-be-processed behavior group sequence to a pre-trained searchrecommendation model, to obtain a label of a candidate recommendationobject in a candidate recommendation object set corresponding to thecurrent query field, where the label is used to indicate a probabilitythat the user performs a response operation on the candidaterecommendation object in the candidate recommendation object set; andobtain, based on the label of the candidate recommendation object,sorted search results corresponding to the current query field. Thesearch recommendation model is used to predict a label of a candidaterecommendation object in search results corresponding to a query fieldwhen a target user inputs the query field. The search recommendationmodel is obtained through using a training sample set as input data andperforming training with a training target of obtaining an object of aresponse operation of a sample user after mask processing. The trainingsample set includes a sample user behavior group sequence and a maskedsample user behavior group sequence. The training sample set includes asample user behavior group sequence and a masked sample user behaviorgroup sequence. The sample user behavior group sequence includes a firstquery field and an object of a response operation of a sample user insearch results corresponding to the first query field. The masked sampleuser behavior group sequence includes a second query field and asequence obtained after mask processing is performed on an object of aresponse operation of the sample user in search results corresponding tothe second query field.

Optionally, in an embodiment, the search recommendation model predictsthe label of the candidate recommendation object based on the queryfield input by the target user and a historical behavior group sequenceof the target user. The historical behavior group sequence of the targetuser is obtained based on a historical query field of the target userand historical behavior data corresponding to the historical queryfield. The historical behavior data corresponding to the historicalquery field is an object of a response operation performed by the targetuser on the search results corresponding to the historical query field.

Optionally, in an embodiment, the sample user behavior group sequencefurther includes identification information. The identificationinformation is used to indicate an association relationship between thefirst query field and the object of the response operation of the sampleuser. The identification information includes a time identifier.

Optionally, in an embodiment, the pre-trained search recommendationmodel is a bidirectional encoder representations from transformers(BERT) model. The training sample set is obtained through performingvectorization processing on the sample user behavior group sequence andthe masked sample user behavior group sequence.

Optionally, in an embodiment, the response operation of the userincludes one or more of a click operation, a download operation, apurchase operation, or a browse operation of the user.

It should be noted that the training apparatus 900 and the apparatus1000 are displayed in a form of function units. The term “unit” hereinmay be implemented in a form of software and/or hardware. This is notspecifically limited.

For example, the “unit” may be a software program, a hardware circuit,or a combination thereof that implements the foregoing functions. Thehardware circuit may include an application-specific integrated circuit(ASIC), an electronic circuit, a processor (for example, a sharedprocessor, a dedicated processor, or a group processor) configured toexecute one or more software or firmware programs and a memory, a mergedlogic circuit, and/or another appropriate component that supports thedescribed function.

Therefore, in the examples described in embodiments of the presentdisclosure, units may be implemented by electronic hardware or acombination of computer software and electronic hardware. Whether thefunctions are performed by hardware or software depends on particularapplications and design constraint conditions of the technicalsolutions. A person skilled in the art may use different methods toimplement the described functions for each particular application, butit should not be considered that the implementation goes beyond thescope of the present disclosure.

FIG. 14 is a schematic diagram of a hardware structure of an apparatusfor training a search recommendation model according to an embodiment ofthe present disclosure.

The training apparatus 1100 (the training apparatus 1100 may be acomputer device) shown in FIG. 14 includes a memory 1101, a processor1102, a communication interface 1103, and a bus 1104. A communicationconnection is implemented between the memory 1101, the processor 1102,and the communication interface 1103 by using the bus 1104.

The memory 1101 may be a read-only memory (ROM), a static storagedevice, a dynamic storage device, or a random access memory (RAM). Thememory 1101 may store a program. When the program stored in the memory1101 is executed by the processor 1102, the processor 1102 is configuredto perform steps of the method for training a search recommendationmodel in the method embodiments of the present disclosure, for example,perform steps shown in FIG. 5 .

It should be understood that the training apparatus shown in thisembodiment may be a server, for example, may be a server of a cloud, ormay be a chip configured in a server of a cloud.

The processor 1102 may be a general-purpose central processing unit(CPU), a microprocessor, an application-specific integrated circuit(ASIC), or one or more integrated circuits, and is configured to executea related program, to implement the method for training a searchrecommendation model in the method embodiments of the presentdisclosure.

Alternatively, the processor 1102 may be an integrated circuit chip, andhas a signal processing capability. In an implementation process, thesteps of the method for training a search recommendation model in thepresent disclosure may be completed by using an integrated logic circuitin a form of hardware or an instruction in a form of software in theprocessor 1102.

The processor 1102 may alternatively be a general-purpose processor, adigital signal processor (DSP), an application-specific integratedcircuit (ASIC), a field programmable gate array (FPGA) or anotherprogrammable logic device, a discrete gate or transistor logic device,or a discrete hardware component. It may implement or perform themethods, the steps, and logical block diagrams that are disclosed inembodiments of the present disclosure. The general-purpose processor maybe a microprocessor, or the processor may be any conventional processoror the like. Steps of the methods disclosed with reference toembodiments of the present disclosure may be directly executed andaccomplished by using a hardware decoding processor, or may be executedand accomplished by using a combination of hardware and software modulesin the decoding processor. A software module may be located in a maturestorage medium in the art, such as a random access memory, a flashmemory, a read-only memory, a programmable read-only memory, anelectrically erasable programmable memory, or a register. The storagemedium is located in the memory 1101. The processor 1102 readsinformation in the memory 1101, and completes, in combination withhardware of the processor 1102, the functions that need to be performedby the units included in the training apparatus shown in FIG. 12 in thisembodiment, or performs the method for training a search recommendationmodel shown in FIG. 5 in the method embodiment of the presentdisclosure.

The communication interface 1103 uses a transceiver apparatus, forexample but not limited to, a transceiver, to implement communicationbetween the training apparatus 1100 and another device or acommunication network.

The bus 1104 may include a channel through which information istransmitted between parts (for example, the memory 1101, the processor1102, and the communication interface 1103) of the training apparatus1100.

FIG. 15 is a schematic diagram of a hardware structure of an apparatusfor sorting search results according to an embodiment of the presentdisclosure.

The apparatus 1200 (the apparatus 1200 may be a computer device) shownin FIG. 15 includes a memory 1201, a processor 1202, a communicationinterface 1203, and a bus 1204. A communication connection isimplemented between the memory 1201, the processor 1202, and thecommunication interface 1203 by using the bus 1204.

The memory 1201 may be a read-only memory (ROM), a static storagedevice, a dynamic storage device, or a random access memory (RAM). Thememory 1201 may store a program. When the program stored in the memory1201 is executed by the processor 1202, the processor 1202 is configuredto perform steps of the method for sorting search results in embodimentsof the present disclosure, for example, perform steps shown in FIG. 10 .

It should be understood that the apparatus shown in this embodiment maybe a smart terminal, or may be a chip configured in the smart terminal.

The processor 1202 may be a general-purpose central processing unit(CPU), a microprocessor, an application-specific integrated circuit(ASIC), or one or more integrated circuits, and is configured to executea related program, to implement the method for sorting search results inembodiments of the present disclosure.

The processor 1202 may alternatively be an integrated circuit chip andhas a signal processing capability. In an implementation process, thesteps of the method for sorting search results in the present disclosuremay be completed by using an integrated logic circuit in a form ofhardware or an instruction in a form of software in the processor 1202.

The processor 1202 may alternatively be a general-purpose processor, adigital signal processor (DSP), an application-specific integratedcircuit (ASIC), a field programmable gate array (FPGA) or anotherprogrammable logic device, a discrete gate or transistor logic device,or a discrete hardware component. It may implement or perform themethods, the steps, and logical block diagrams that are disclosed inembodiments of the present disclosure. The general-purpose processor maybe a microprocessor, or the processor may be any conventional processoror the like. Steps of the methods disclosed with reference toembodiments of the present disclosure may be directly executed andaccomplished by using a hardware decoding processor, or may be executedand accomplished by using a combination of hardware and software modulesin the decoding processor. A software module may be located in a maturestorage medium in the art, such as a random access memory, a flashmemory, a read-only memory, a programmable read-only memory, anelectrically erasable programmable memory, or a register. The storagemedium is located in the memory 1201. The processor 1202 readsinformation in the memory 1201, and completes, in combination withhardware of the processor 1202, the functions that need to be performedby the units included in the apparatus shown in FIG. 13 in thisembodiment, or performs the method for sorting search results shown inFIG. 10 in the method embodiment of the present disclosure.

The communication interface 1203 uses a transceiver apparatus, forexample but not limited to, a transceiver, to implement communicationbetween the apparatus 1200 and another device or a communicationnetwork.

The bus 1204 may include a channel through which information istransmitted between parts (for example, the memory 1201, the processor1202, and the communication interface 1203) of the apparatus 1200.

It should be noted that although only the memory, the processor, and thecommunication interface of each of the training apparatus 1100 and theapparatus 1200 are illustrated, in a specific implementation process, aperson skilled in the art should understand that the training apparatus1100 and the apparatus 1200 each further include other componentsnecessary for implementing normal operation. In addition, based on aspecific requirement, a person skilled in the art should understand thatthe training apparatus 1100 and the apparatus 1200 each may furtherinclude a hardware component for implementing another additionalfunction.

In addition, a person skilled in the art should understand that thetraining apparatus 1100 and the apparatus 1200 each may include onlycomponents necessary for implementing embodiments of the presentdisclosure, but not necessarily include all the components shown in FIG.14 or FIG. 15 .

An embodiment of the present disclosure further provides a chip. Thechip includes a transceiver unit and a processing unit. The transceiverunit may be an input/output circuit or a communication interface. Theprocessing unit is a processor, a microprocessor, or an integratedcircuit integrated on the chip. The chip may perform the method fortraining a search recommendation model in the foregoing methodembodiment.

An embodiment of the present disclosure further provides a chip. Thechip includes a transceiver unit and a processing unit. The transceiverunit may be an input/output circuit or a communication interface. Theprocessing unit is a processor, a microprocessor, or an integratedcircuit integrated on the chip. The chip may perform the method forsorting search results in the foregoing method embodiment.

An embodiment of the present disclosure further provides acomputer-readable storage medium. The computer-readable storage mediumstores instructions. When the instructions are executed, the method fortraining a search recommendation model in the foregoing methodembodiment is executed.

An embodiment of the present disclosure further provides acomputer-readable storage medium. The computer-readable storage mediumstores instructions. When the instructions are executed, the method forsorting search results in the foregoing method embodiment is executed.

An embodiment of the present disclosure further provides a computerprogram product including instructions. When the instructions areexecuted, the method for training a search recommendation model in theforegoing method embodiment is executed.

An embodiment of the present disclosure further provides a computerprogram product including instructions. When the instructions areexecuted, the method for sorting search results in the foregoing methodembodiment is executed.

It should be understood that, the processor in embodiments of thepresent disclosure may be a central processing unit (CPU). The processormay be further another general-purpose processor, a digital signalprocessor (DSP), an application-specific integrated circuit (ASIC), afield programmable gate array (FPGA), or another programmable logicdevice, discrete gate or transistor logic device, discrete hardwarecomponent, or the like. The general-purpose processor may be amicroprocessor, or the processor may be any conventional processor orthe like.

It may be understood that the memory in embodiments of the presentdisclosure may be a volatile memory or a nonvolatile memory, or mayinclude a volatile memory and a nonvolatile memory. The nonvolatilememory may be a read-only memory (ROM), a programmable read-only memory(programmable ROM, PROM), an erasable programmable read-only memory(erasable PROM, EPROM), an electrically erasable programmable read-onlymemory (electrically EPROM, EEPROM), or a flash memory. The volatilememory may be a random access memory (RAM), used as an external cache.Through an example rather than a limitative description, random accessmemories (RAM) in many forms may be used, for example, a static randomaccess memory (static RAM, SRAM), a dynamic random access memory (DRAM),a synchronous dynamic random access memory (synchronous DRAM, SDRAM), adouble data rate synchronous dynamic random access memory (double datarate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random accessmemory (enhanced SDRAM, ESDRAM), a synchlink dynamic random accessmemory (synchlink DRAM, SLDRAM), and a direct rambus random accessmemory (direct rambus RAM, DR RAM).

All or some of the foregoing embodiments may be implemented usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement embodiments, the foregoing embodiments may beimplemented completely or partially in a form of a computer programproduct. The computer program product includes one or more computerinstructions or computer programs. When the program instructions or thecomputer programs are loaded and executed on the computer, the procedureor functions according to embodiments of the present disclosure are allor partially generated. The computer may be a general-purpose computer,a dedicated computer, a computer network, or other programmableapparatuses. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, infrared, radio, andmicrowave, or the like) manner. The computer-readable storage medium maybe any usable medium accessible by a computer, or a data storage device,such as a server or a data center, integrating one or more usable media.The usable medium may be a magnetic medium (for example, a floppy disk,a hard disk, or a magnetic tape), an optical medium (for example, aDVD), or a semiconductor medium. The semiconductor medium may be asolid-state drive.

It should be understood that the term “and/or” in this specificationdescribes only an association relationship between associated objects,and indicates that three relationships may exist. For example, A and/orB may indicate any one of the following three cases: Only A exists, bothA and B exist, or only B exists. A and B may be singular or plural. Inaddition, the character “/” in this specification usually indicates an“or” relationship between associated objects, or may indicate an“and/or” relationship. A specific meaning depends on the context.

In the present disclosure, at least one means one or more, and aplurality of means two or more. At least one of the following items(pieces) or a similar expression thereof refers to any combination ofthese items, including any combination of singular items (pieces) orplural items (pieces). For example, at least one of a, b, or c mayindicate a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c may besingular or plural.

It should be understood that sequence numbers of the foregoing processesdo not mean execution sequences in various embodiments of the presentdisclosure. The execution sequences of the processes should bedetermined according to functions and internal logic of the processes,and should not be construed as any limitation on the implementationprocesses of embodiments of the present disclosure.

A person of ordinary skill in the art understand that, in combinationwith the examples described in embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of the present disclosure.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments, and detailsare not described herein again.

In the several embodiments provided in the present disclosure, it shouldbe understood that the disclosed systems, apparatuses, and methods maybe implemented in another manner. For example, the described apparatusembodiment is merely an example. For example, division into the units ismerely logical function division and may be other division during actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented by using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of embodiments.

In addition, functional units in embodiments of the present disclosuremay be integrated into one processing unit, or each of the units mayexist alone physically, or two or more units may be integrated into oneunit.

When the functions are implemented in the form of a software functionalunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of the present disclosureessentially, or the part contributing to the conventional technology, orsome of the technical solutions may be implemented in a form of asoftware product. The computer software product is stored in a storagemedium, and includes several instructions for instructing a computerdevice (which may be a personal computer, a server, or a network device)to perform all or some of the steps of the methods described inembodiments of the present disclosure. The foregoing storage mediumincludes: any medium that can store program code, such as a USB flashdrive, a removable hard disk, a read-only memory (ROM), a random accessmemory (RAM), a magnetic disk, or an optical disc.

The foregoing descriptions are merely non-limiting examples of specificimplementations and are not intended to limit the protection scope,which is intended to cover any variation or replacement readilydetermined by a person of ordinary skill in the art. Therefore, theclaims shall define the protection scope.

What is claimed is:
 1. A training method for training a searchrecommendation model, comprising: obtaining a training sample set,wherein the training sample set comprises a sample user behavior groupsequence and a masked sample user behavior group sequence, the sampleuser behavior group sequence comprises a first query field and an objectof a response operation of a sample user in search results correspondingto the first query field, and the masked sample user behavior groupsequence comprises a second query field and a sequence obtained aftermask processing is performed on an object of a response operation of thesample user in search results corresponding to the second query field;and using the training sample set as input data, and training a searchrecommendation model, to obtain a trained search recommendation model,wherein a target of the training is to obtain the object of the responseoperation of the sample user after the mask processing, the searchrecommendation model is used to predict a label of a candidaterecommendation object in search results corresponding to a query fieldwhen a target user inputs the query field, and the label indicates aprobability that the target user performs a response operation on thecandidate recommendation object.
 2. The training method according toclaim 1, wherein the search recommendation model predicts the label ofthe candidate recommendation object based on the query field input bythe target user and a historical behavior group sequence of the targetuser, the historical behavior group sequence of the target user isobtained based on a historical query field of the target user andhistorical behavior data corresponding to the historical query field,and the historical behavior data corresponding to the historical queryfield is an object of a response operation performed by the target useron the search results corresponding to the historical query field. 3.The training method according to claim 1, wherein the sample userbehavior group sequence further comprises identification information,the identification information indicates an association relationshipbetween the first query field and the object of the response operationof the sample user, and the identification information comprises a timeidentifier.
 4. The training method according to claim 1, wherein thesearch recommendation model is a bidirectional encoder representationsfrom transformers (BERT) model, and the method further comprises:performing vectorization processing on the sample user behavior groupsequence and the masked sample user behavior group sequence, to obtain avector sequence; and the using of the training sample set as input datacomprises: inputting the vector sequence to the BERT model.
 5. Thetraining method according to claim 1, wherein the response operation ofthe sample user comprises one or more of a click operation, a downloadoperation, a purchase operation, or a browse operation of the sampleuser.
 6. A method for sorting search results, comprising: obtaining ato-be-processed user behavior group sequence of a user, wherein theto-be-processed user behavior group sequence comprises a current queryfield of the user and a sequence obtained after mask processing isperformed on an object of a response operation of the user; inputtingthe to-be-processed user behavior group sequence to a pre-trained searchrecommendation model, to obtain a label of a candidate recommendationobject in a candidate recommendation object set corresponding to thecurrent query field, wherein the label indicates a probability that theuser performs a response operation on the candidate recommendationobject in the candidate recommendation object set; and obtaining, basedon the label of the candidate recommendation object, sorted searchresults corresponding to the current query field, wherein the searchrecommendation model is used to predict a label of a candidaterecommendation object in search results corresponding to a query fieldwhen a target user inputs the query field, the search recommendationmodel is obtained through using a training sample set as input data andperforming training with a training target of obtaining an object of aresponse operation of a sample user after mask processing, the trainingsample set comprises a sample user behavior group sequence and a maskedsample user behavior group sequence, the sample user behavior groupsequence comprises a first query field and an object of a responseoperation of a sample user in search results corresponding to the firstquery field, and the masked sample user behavior group sequencecomprises a second query field and a sequence obtained after maskprocessing is performed on an object of a response operation of thesample user in search results corresponding to the second query field.7. The method according to claim 6, wherein the search recommendationmodel predicts the label of the candidate recommendation object based onthe query field input by the target user and a historical behavior groupsequence of the target user, the historical behavior group sequence ofthe target user is obtained based on a historical query field of thetarget user and historical behavior data corresponding to the historicalquery field, and the historical behavior data corresponding to thehistorical query field is an object of a response operation performed bythe target user on the search results corresponding to the historicalquery field.
 8. The method according to claim 6, wherein the sample userbehavior group sequence further comprises identification information,the identification information indicates an association relationshipbetween the first query field and the object of the response operationof the sample user, and the identification information comprises a timeidentifier.
 9. The method according to claim 6, wherein the pre-trainedsearch recommendation model is a bidirectional encoder representationsfrom transformers (BERT) model, the training sample set is obtainedthrough performing vectorization processing on the sample user behaviorgroup sequence and the masked sample user behavior group sequence. 10.The method according to claim 6, wherein the response operation of theuser comprises one or more of a click operation, a download operation, apurchase operation, or a browse operation of the user.
 11. An apparatusfor training a search recommendation model, comprising at least oneprocessor and a memory, wherein the at least one processor is coupled tothe memory, and is configured to execute instructions in the memory, toenable the apparatus to perform operations comprising: obtaining atraining sample set, wherein the training sample set comprises a sampleuser behavior group sequence and a masked sample user behavior groupsequence, the sample user behavior group sequence comprises a firstquery field and an object of a response operation of a sample user insearch results corresponding to the first query field, and the maskedsample user behavior group sequence comprises a second query field and asequence obtained after mask processing is performed on an object of aresponse operation of the sample user in search results corresponding tothe second query field; and using the training sample set as input data,and training a search recommendation model, to obtain a trained searchrecommendation model, wherein a target of the training is to obtain theobject of the response operation of the sample user after the maskprocessing, the search recommendation model is used to predict a labelof a candidate recommendation object in search results corresponding toa query field when a target user inputs the query field, and the labelindicates a probability that the target user performs a responseoperation on the candidate recommendation object.
 12. The apparatusaccording to claim 11, wherein the search recommendation model predictsthe label of the candidate recommendation object based on the queryfield input by the target user and a historical behavior group sequenceof the target user, the historical behavior group sequence of the targetuser is obtained based on a historical query field of the target userand historical behavior data corresponding to the historical queryfield, and the historical behavior data corresponding to the historicalquery field is an object of a response operation performed by the targetuser on the search results corresponding to the historical query field.13. The apparatus according to claim 11, wherein the sample userbehavior group sequence further comprises identification information,the identification information indicates an association relationshipbetween the first query field and the object of the response operationof the sample user, and the identification information comprises a timeidentifier.
 14. The apparatus according to claim 11, wherein the searchrecommendation model is a bidirectional encoder representations fromtransformers (BERT) model, and the processor is configured to executeinstructions in the memory, to enable the apparatus to performoperations comprising: performing vectorization processing on the sampleuser behavior group sequence and the masked sample user behavior groupsequence, to obtain a vector sequence; and inputting the vector sequenceto the BERT model.
 15. An apparatus for sorting search results,comprising at least one processor and a memory, wherein the at least oneprocessor is coupled to the memory, and is configured to executeinstructions in the memory, to enable the apparatus to performoperations comprising: obtaining a to-be-processed user behavior groupsequence of a user, wherein the to-be-processed user behavior groupsequence comprises a current query field of the user and a sequenceobtained after mask processing is performed on an object of a responseoperation of the user; inputting the to-be-processed user behavior groupsequence to a pre-trained search recommendation model, to obtain a labelof a candidate recommendation object in a candidate recommendationobject set corresponding to the current query field, wherein the labelindicates a probability that the user performs a response operation onthe candidate recommendation object in the candidate recommendationobject set; and obtaining, based on the label of the candidaterecommendation object, sorted search results corresponding to thecurrent query field, wherein the search recommendation model is used topredict a label of a candidate recommendation object in search resultscorresponding to a query field when a target user inputs the queryfield, the search recommendation model is obtained through using atraining sample set as input data and performing training with atraining target of obtaining an object of a response operation of asample user after mask processing, the training sample set comprises asample user behavior group sequence and a masked sample user behaviorgroup sequence, the sample user behavior group sequence comprises afirst query field and an object of a response operation of a sample userin search results corresponding to the first query field, and the maskedsample user behavior group sequence comprises a second query field and asequence obtained after mask processing is performed on an object of aresponse operation of the sample user in search results corresponding tothe second query field.
 16. The apparatus according to claim 15, whereinthe search recommendation model predicts the label of the candidaterecommendation object based on the query field input by the target userand a historical behavior group sequence of the target user, thehistorical behavior group sequence of the target user is obtained basedon a historical query field of the target user and historical behaviordata corresponding to the historical query field, and the historicalbehavior data corresponding to the historical query field is an objectof a response operation performed by the target user on the searchresults corresponding to the historical query field.
 17. The apparatusaccording to claim 15, wherein the sample user behavior group sequencefurther comprises identification information, the identificationinformation indicates an association relationship between the firstquery field and the object of the response operation of the sample user,and the identification information comprises a time identifier.
 18. Theapparatus according to claim 15, wherein the search recommendation modelis a bidirectional encoder representations from transformers (BERT)model, and the at least one processor is configured to executeinstructions in the memory, to enable the apparatus to performoperations comprising: performing vectorization processing on the sampleuser behavior group sequence and the masked sample user behavior groupsequence, to obtain a vector sequence; and inputting the vector sequenceto the BERT model.
 19. A non-transitory computer-readable medium,storing program code that, when executed by a computer, enables thecomputer to perform the training method according to claim
 1. 20. Anon-transitory computer-readable medium, storing program code that, whenexecuted by a computer, enables the computer to perform the methodaccording to claim 6.